ypeError: Result of expression 'printWindow' [undefined] is not an object.

Posted by orangebrainer on Stack Overflow See other posts from Stack Overflow or by orangebrainer
Published on 2010-06-08T03:56:10Z Indexed on 2010/06/08 4:02 UTC
Read the original article Hit count: 140

Filed under:
|
|
|
|

I'm trying to create hidden iframes in my page dynamically to load 3 other pages so that i can grab all the HTML and combine them into 1 in a new window.

However i'm stuck at this. tHe frames are created fine. But whenever the javascript runs to the part of

openNewWindow(); { var printWindow = window.open("",""); printWindow.document.open(); printWindow.document.write(HTMLfromFrames); printWindow.document.close(); }

i get this error: TypeError: Result of expression 'printWindow' [undefined] is not an object.

but if i generate a button to call this function seperately, it works fine. however i need it to run all in one click event

Anybody as any idea what's wrong? Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about iframe